import settings from '@/settings'
export function numeric(text) {
  return text;
}

export function fixed(text) {
  if (text) {
    return text.toFixed(2)
  } else {
    return `0`
  }
}

export function file(value, isImage) {
  if (value) {
    if (typeof value === "string") {
      return settings.webapi.fileURL + value;
    } else if (isImage) {
      return URL.createObjectURL(value);
    } else {
      return value.name;
    }
  } else {
    return "";
  }
}
